/*
 * TransferFactory.cpp
 *
 *  Created on: 11.4.2011
 *      Author: Tomas
 */

#include "TransferFactory.h"

Transfer* TransferFactory::factory
	(const Packet& p, IFile& fs, struct sockaddr_in client, std::ostream& logger)
{
	if(p.opcode == Packet::RRQ)
		return new TransferRead(client, fs, p.filename, p.mode, logger);
	if(p.opcode == Packet::WRQ)
		return new TransferWrite(client, fs, p.filename, p.mode, logger);
	return NULL;
}
